/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.kassa;

import java.awt.Dimension;
import java.awt.Toolkit;
import org.kassa.dao.ItemDao;
import org.kassa.dao.ItemDaoImpl;
import org.kassa.dao.SellingDao;
import org.kassa.dao.SellingDaoImpl;
import org.kassa.model.Item;
import org.kassa.model.Selling;

/**
 *
 * @author madmeat
 */

public class MainFrame extends javax.swing.JFrame {

    /**
     * Creates new form MainFrame
     */
    
    public MainFrame() {
        initComponents();
        Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
        this.setLocation((int) dimension.width/3, (int) dimension.height/4);
    }

    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        commitDialog = new javax.swing.JDialog();
        okDialogButton = new javax.swing.JButton();
        cancelDialogButton = new javax.swing.JButton();
        commitLabel = new javax.swing.JLabel();
        customDialog = new javax.swing.JDialog();
        customDialogButton = new javax.swing.JToggleButton();
        customDialogLabel = new javax.swing.JLabel();
        arrivalFrame = new javax.swing.JFrame();
        arrivalFrameCodeLabel = new javax.swing.JLabel();
        arrivalFrameQuantityLabel = new javax.swing.JLabel();
        arrivalFrameCodeTextField = new javax.swing.JTextField();
        arrivalFrameQuantityTextField = new javax.swing.JTextField();
        arrivalFrameAddButton = new javax.swing.JButton();
        arrivalFrameDoneButton = new javax.swing.JButton();
        mainPanel = new javax.swing.JPanel();
        codeLabel = new javax.swing.JLabel();
        codeTextField = new javax.swing.JTextField();
        quantityLabel = new javax.swing.JLabel();
        quantityTextField = new javax.swing.JTextField();
        okButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        arrivalMenuItem = new javax.swing.JMenuItem();
        reportsMenuItem = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        exitMenuItem = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();

        okDialogButton.setText("OK");
        okDialogButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okDialogButtonActionPerformed(evt);
            }
        });

        cancelDialogButton.setText("Cancel");
        cancelDialogButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelDialogButtonActionPerformed(evt);
            }
        });

        commitLabel.setText("Commit?");

        javax.swing.GroupLayout commitDialogLayout = new javax.swing.GroupLayout(commitDialog.getContentPane());
        commitDialog.getContentPane().setLayout(commitDialogLayout);
        commitDialogLayout.setHorizontalGroup(
            commitDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(commitDialogLayout.createSequentialGroup()
                .addGroup(commitDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(commitDialogLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(okDialogButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                        .addComponent(cancelDialogButton))
                    .addGroup(commitDialogLayout.createSequentialGroup()
                        .addGap(70, 70, 70)
                        .addComponent(commitLabel)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        commitDialogLayout.setVerticalGroup(
            commitDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(commitDialogLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(commitLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(commitDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(cancelDialogButton)
                    .addComponent(okDialogButton))
                .addContainerGap())
        );

        customDialog.setResizable(false);

        customDialogButton.setText("OK");
        customDialogButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        customDialogButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customDialogButtonActionPerformed(evt);
            }
        });

        customDialogLabel.setText("Default text");

        javax.swing.GroupLayout customDialogLayout = new javax.swing.GroupLayout(customDialog.getContentPane());
        customDialog.getContentPane().setLayout(customDialogLayout);
        customDialogLayout.setHorizontalGroup(
            customDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(customDialogLayout.createSequentialGroup()
                .addGap(66, 66, 66)
                .addGroup(customDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(customDialogLabel)
                    .addComponent(customDialogButton, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(0, 69, Short.MAX_VALUE))
        );
        customDialogLayout.setVerticalGroup(
            customDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, customDialogLayout.createSequentialGroup()
                .addContainerGap(24, Short.MAX_VALUE)
                .addComponent(customDialogLabel)
                .addGap(18, 18, 18)
                .addComponent(customDialogButton)
                .addContainerGap())
        );

        arrivalFrame.setResizable(false);

        arrivalFrameCodeLabel.setText("Code");

        arrivalFrameQuantityLabel.setText("Quantity");

        arrivalFrameAddButton.setText("Add");
        arrivalFrameAddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                arrivalFrameAddButtonActionPerformed(evt);
            }
        });

        arrivalFrameDoneButton.setText("Done");
        arrivalFrameDoneButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                arrivalFrameDoneButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout arrivalFrameLayout = new javax.swing.GroupLayout(arrivalFrame.getContentPane());
        arrivalFrame.getContentPane().setLayout(arrivalFrameLayout);
        arrivalFrameLayout.setHorizontalGroup(
            arrivalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(arrivalFrameLayout.createSequentialGroup()
                .addGap(82, 82, 82)
                .addGroup(arrivalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(arrivalFrameLayout.createSequentialGroup()
                        .addGroup(arrivalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(arrivalFrameQuantityLabel)
                            .addComponent(arrivalFrameCodeLabel))
                        .addGap(59, 59, 59)
                        .addGroup(arrivalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(arrivalFrameQuantityTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 91, Short.MAX_VALUE)
                            .addComponent(arrivalFrameCodeTextField)))
                    .addGroup(arrivalFrameLayout.createSequentialGroup()
                        .addComponent(arrivalFrameAddButton, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
                        .addComponent(arrivalFrameDoneButton, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(96, Short.MAX_VALUE))
        );
        arrivalFrameLayout.setVerticalGroup(
            arrivalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(arrivalFrameLayout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addGroup(arrivalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(arrivalFrameCodeLabel)
                    .addComponent(arrivalFrameCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(56, 56, 56)
                .addGroup(arrivalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(arrivalFrameQuantityLabel)
                    .addComponent(arrivalFrameQuantityTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(40, 40, 40)
                .addGroup(arrivalFrameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(arrivalFrameAddButton)
                    .addComponent(arrivalFrameDoneButton))
                .addContainerGap(64, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(400, 300));

        codeLabel.setText("Code");

        quantityLabel.setText("Quantity");

        okButton.setText("OK");
        okButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okButtonActionPerformed(evt);
            }
        });

        cancelButton.setText("Cancel");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
        mainPanel.setLayout(mainPanelLayout);
        mainPanelLayout.setHorizontalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(codeLabel))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(54, 54, 54)
                        .addComponent(okButton, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addGap(12, 12, 12)
                        .addComponent(quantityLabel)))
                .addGap(124, 124, 124)
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(quantityTextField)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(cancelButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE))
                    .addComponent(codeTextField))
                .addContainerGap())
        );
        mainPanelLayout.setVerticalGroup(
            mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(mainPanelLayout.createSequentialGroup()
                .addGap(51, 51, 51)
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(codeLabel)
                    .addComponent(codeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(quantityLabel)
                        .addContainerGap())
                    .addGroup(mainPanelLayout.createSequentialGroup()
                        .addComponent(quantityTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 81, Short.MAX_VALUE)
                        .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancelButton)
                            .addComponent(okButton))
                        .addGap(72, 72, 72))))
        );

        fileMenu.setText("File");

        arrivalMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));
        arrivalMenuItem.setText("Arrival");
        arrivalMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                arrivalMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(arrivalMenuItem);

        reportsMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK));
        reportsMenuItem.setText("Reports");
        reportsMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                reportsMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(reportsMenuItem);
        fileMenu.add(jSeparator1);

        exitMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.ALT_MASK));
        exitMenuItem.setText("Exit");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        helpMenu.setText("Help");
        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(mainPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    
    
    //Action listeners
    
    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        this.dispose();
    }//GEN-LAST:event_exitMenuItemActionPerformed

    private void reportsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reportsMenuItemActionPerformed
        new ReportsFrame(this).setVisible(true);
    }//GEN-LAST:event_reportsMenuItemActionPerformed

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        clearCodeAndQuantity();
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
        
        try {
            Integer.parseInt(codeTextField.getText());
            Integer.parseInt(quantityTextField.getText());
            commitDialog.setSize(200, 100);
            commitDialog.setLocationRelativeTo(this);
            commitDialog.setVisible(true);
        } catch (NumberFormatException e) {
            showCustomDialog("Error parsing numbers");
        }
        
    }//GEN-LAST:event_okButtonActionPerformed

    private void cancelDialogButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelDialogButtonActionPerformed
        commitDialog.dispose();
    }//GEN-LAST:event_cancelDialogButtonActionPerformed

    private void okDialogButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okDialogButtonActionPerformed
        
        Item item = new Item(Integer.parseInt(codeTextField.getText()));
        item.setQuantity(Integer.parseInt(quantityTextField.getText()));
        if (! item.exists()) showCustomDialog("Unknown code");
        
        Selling selling = new Selling(item);
        if (selling.sell()) {
            showCustomDialog("Commitment done");
        } else {
            showCustomDialog("There were some errors");
        }
        
        clearCodeAndQuantity();
        commitDialog.dispose();
    }//GEN-LAST:event_okDialogButtonActionPerformed

    private void customDialogButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customDialogButtonActionPerformed
        customDialog.dispose();
    }//GEN-LAST:event_customDialogButtonActionPerformed

    private void arrivalFrameAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_arrivalFrameAddButtonActionPerformed
        try {
            Item item = new Item(Integer.parseInt(arrivalFrameCodeTextField.getText()));
            item.setQuantity(Integer.parseInt(arrivalFrameQuantityTextField.getText()));
            if (item.exists()) {
                if(item.arrive()){
                    showCustomDialog("Added items");
                } else {
                    showCustomDialog("Error adding items");
                }
                clearArrivalCodeAndQuantity();
            } else {
                showCustomDialog("Invalid code");
            }
        } catch (NumberFormatException e) {
            showCustomDialog("Error parsing numbers");
        }
   }//GEN-LAST:event_arrivalFrameAddButtonActionPerformed

    private void arrivalFrameDoneButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_arrivalFrameDoneButtonActionPerformed
        // TODO add your handling code here:
        arrivalFrame.dispose();
    }//GEN-LAST:event_arrivalFrameDoneButtonActionPerformed

    private void arrivalMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_arrivalMenuItemActionPerformed
        arrivalFrame.setSize(400, 300);
        arrivalFrame.setLocationRelativeTo(this);
        arrivalFrame.setVisible(true);
    }//GEN-LAST:event_arrivalMenuItemActionPerformed

    
    // helpers
    private void showCustomDialog (String message) {
        customDialogLabel.setText(message);
        customDialog.setSize(270, 100);
        customDialog.setLocationRelativeTo(this);
        customDialog.setVisible(true);
    }
    
    private void clearCodeAndQuantity() {                    
        quantityTextField.setText("");
        codeTextField.setText("");
    }
    
    private void clearArrivalCodeAndQuantity() {
        arrivalFrameQuantityTextField.setText("");
        arrivalFrameCodeTextField.setText("");
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JFrame arrivalFrame;
    private javax.swing.JButton arrivalFrameAddButton;
    private javax.swing.JLabel arrivalFrameCodeLabel;
    private javax.swing.JTextField arrivalFrameCodeTextField;
    private javax.swing.JButton arrivalFrameDoneButton;
    private javax.swing.JLabel arrivalFrameQuantityLabel;
    private javax.swing.JTextField arrivalFrameQuantityTextField;
    private javax.swing.JMenuItem arrivalMenuItem;
    private javax.swing.JButton cancelButton;
    private javax.swing.JButton cancelDialogButton;
    private javax.swing.JLabel codeLabel;
    private javax.swing.JTextField codeTextField;
    private javax.swing.JDialog commitDialog;
    private javax.swing.JLabel commitLabel;
    private javax.swing.JDialog customDialog;
    private javax.swing.JToggleButton customDialogButton;
    private javax.swing.JLabel customDialogLabel;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPanel mainPanel;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JButton okButton;
    private javax.swing.JButton okDialogButton;
    private javax.swing.JLabel quantityLabel;
    private javax.swing.JTextField quantityTextField;
    private javax.swing.JMenuItem reportsMenuItem;
    // End of variables declaration//GEN-END:variables
    
}
